package cn.hanyx.coder.design.pattern.structural.proxy.demo01;

/**
 * UserControllerProxy02
 *
 * @author hanyx
 * @date 2020/05/18
 */
public class UserControllerProxy02 extends UserController {
    private MetricsCollector metricsCollector;

    public UserControllerProxy02() {
        this.metricsCollector = new MetricsCollector();
    }

    @Override
    public UserVo login(String phone, String password) {
        UserVo vo = super.login(phone, password);
        metricsCollector.recordRequest();
        return vo;
    }

    @Override
    public UserVo register(String phone, String password) {
        UserVo vo = super.register(phone, password);
        metricsCollector.recordRequest();
        return vo;
    }

    public static void main(String[] args) {
        UserController userController = new UserControllerProxy02();
    }
}
